home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / forms / datawiz / dfdclass.cls < prev    next >
Encoding:
Text File  |  1996-03-29  |  1.5 KB  |  52 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4. END
  5. Attribute VB_Name = "DFWizardClass"
  6. Attribute VB_Creatable = True
  7. Attribute VB_Exposed = True
  8. Attribute VB_Description = "Data Form Designer"
  9. Dim AddInItems As Object    'VBIDE.MenuItems
  10. Dim DFDMenu As Object       'VBIDE.MenuLine
  11. Dim ConnectID As Long
  12.  
  13. '------------------------------------------------------
  14. 'this method adds the Add-In to the VB menu
  15. 'it is called by the VB addin manager
  16. '------------------------------------------------------
  17. Sub ConnectAddIn(VBInst As VBIDE.Application)
  18.   On Error GoTo error_handler
  19.     
  20.   Set gobjIDEAppInst = VBInst
  21.   Set AddInItems = VBInst.AddInMenu.MenuItems
  22.   Set DFDMenu = AddInItems.Add("Data Form Wizard...")
  23.   ConnectID = DFDMenu.ConnectEvents(Me)
  24.  
  25.   Exit Sub
  26.     
  27. error_handler:
  28.   MsgBox Err.Description
  29.   Exit Sub
  30.     
  31. End Sub
  32.  
  33. '------------------------------------------------------
  34. 'this method removes the Add-In from the VB menu
  35. 'it is called by the VB addin manager
  36. '------------------------------------------------------
  37. Sub DisconnectAddIn(ByVal mode As Integer)
  38.   'Disconnect the event handler
  39.   DFDMenu.DisconnectEvents ConnectID
  40.   'remove it from the menu
  41.   AddInItems.Remove DFDMenu
  42. End Sub
  43.  
  44. '------------------------------------------------------
  45. 'this is the method that is executed when the user
  46. 'selects the Add-In from the VB menu
  47. '------------------------------------------------------
  48. Sub AfterClick()
  49.   'load and show the form
  50.   frmDFD.Show vbModal
  51. End Sub
  52.